package com.example.zhaohang.intentbudle;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;

public class OneActivity extends AppCompatActivity {

    private TextView mTextView;
    private String mOne;
    private String mTwo;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_one);
        mTextView = (TextView) findViewById(R.id.activity_one);

        Bundle extras = getIntent().getExtras();
        mOne = extras.getString("one");
        mTwo = extras.getString("two");
        if (mOne!=null){
            mTextView.setText(mOne);
        }else {
            mTextView.setText(mTwo);
        }
    }
}
